﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="Test.WebForm1" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="/javascript/library/jquery.min.js"></script>
    <link rel="stylesheet" type="text/css" href="/dist/semantic.css" />
    <link rel="stylesheet" type="text/css" href="/dist/docs.css" />
    <link rel="stylesheet" type="text/css" href="/dist/rtl.css" />
    <script src="/dist/semantic.js"></script>
    <script src="/javascript/library/less.js"></script>
    <script src="/javascript/library/highlight.js"></script>
    <script src="/javascript/library/highlight.languages.js"></script>
    <script src="/javascript/library/history.js"></script>
    <script src="/javascript/library/tablesort.js"></script>
    <script src="/javascript/docs.js"></script>
    <script src="/javascript/grid.js"></script>
    <script src="/javascript/menu.js"></script>
    <script src="/javascript/popup.js"></script>
    <script src="/javascript/icon.js"></script>
    <script src="/javascript/transition.js"></script>
</head>
<body>
    <div class="container" id="MainContainer">
        <div class="ui fixed inverted main menu" id="fixedmenu">
            <div class="container">

                <div class="right menu">
                    <a class="popup icon setting item" data-content="Account Setting" onclick="showAccountSetting();">
                        <i class="alternate setting icon"></i>
                    </a>
                    <div class="ui language dropdown item" id="languages">
                        <i class="world icon"></i>
                        <div class="center"></div>
                        <div class="menu" style="background-color: #000000">
                            <div class="item" data-percent="100" data-value="en" data-english="English">English</div>
                            <div class="item" data-percent="34" data-value="zh" data-english="Chinese">简体中文</div>
                        </div>
                    </div>
                    <a class="popup icon sign out item" data-content="Sign Out" onclick="signOut();">
                        <i class="alternate sign out icon"></i>
                    </a>
                </div>
            </div>
        </div>
        <div style="height: 40px"></div>
        <div class="sizer four wide column" style="font-size: 28px; border-style: none; text-align: left">
            <h1 class="ui huge header transition hidden" id="Header">良帅企业资源管理</h1>
        </div>
        <div class="transition hidden" style="border-top: 2px solid #000000; height: 0px" id="TitleDivider"></div>
        <div class="ui vertical menu transition hidden" id="MainMenu" style="left: 5px; position: relative">
            <div class="header item">
                <i class=""></i>
                库存管理
            </div>
            <a class="item" onclick="DisplayAction(this);" id="BankIn">入库
            </a>
            <a class="item" onclick="DisplayAction(this);" id="BankOut">出库
            </a>
            <a class="item" onclick="DisplayAction(this);" id="ActionHistory">历史查询
            </a>
        </div>
    </div>
    <div class="ui form segment transition hidden" style="position: absolute; height: 200px; width: 500px; left: 230px; top: 145px" id="BankInPage">
        <h1 style="position: relative; margin-top: -10px">入库</h1>
        <div class="label" style="display: inline">类型: </div>
        <div class="ui selection dropdown labeled search" id="库存类型" style="display: inline; height: 5px">
            <span class="text">入库类型</span>
            <i class="dropdown icon"></i>
            <div class="menu" id="MaterialContent">
                <div class="item">成衣</div>
                <div class="item">裁片</div>
                <div class="item">辅料</div>
                <div class="item">后整</div>
            </div>
        </div>
    </div>
    <div class="ui form segment transition hidden" style="position: absolute; height: 500px; width: 1100px; left: 230px; top: 107px" id="ActionHistoryPage">
    </div>
</body>
</html>
<script type="text/javascript">
    var currentpage = null;
    $('#Header').transition('fly left');
    setTimeout(function () { $('#TitleDivider').transition('fly down'); }, 400);
    setTimeout(function () { $('#MainMenu').transition('fly down'); }, 800);

    function DisplayAction(selectedItem) {

        var jsonResult = {};
        $.ajax({

            url: "http://cdc311144.gdnchina.com/WebService.asmx/GetActionType",
            type: "POST",
            dataType: 'json',
            //contentType: 'application/json',
            data: "",
            async: false,
            success: function (json) {
                //alert(json);
                jsonResult = json;
            },
            error: function (err) {
                alert(err);
                console.log(err);
            }
        });

        //var sendData = $.parseJSON('{ "actionTypeId": "2" }');
        //$.ajax({

        //    url: "http://localhost:15974/WebService.asmx/GetCutPartsBankInOrOuts",
        //    type: "POST",
        //    dataType: 'json',
        //    //contentType: "application/json",
        //    data: sendData,
        //    //processData :false,
        //    async: false,
        //    success: function (json) {
        //        alert(json);
        //        outPuts = json;
        //    },
        //    error: function (err) {
        //        alert(err);
        //        console.log(err);
        //    }
        //});


        var name = '#' + selectedItem.id + 'Page';
        if (currentpage != name) {
            if (currentpage == null) {
                currentpage = name;
                $(name).transition('fly left');
            } else {
                $(currentpage).transition('fly right');
                currentpage = name;
                setTimeout(function () { $(name).transition('fly left'); }, 500);
            }
        }

        var htmlContent = '';
        $('#MaterialContent').empty();
        $.each(jsonResult, function (index, obj) {
            //alert('Name:' + obj.ID + ', Value:' + obj.ActionTypeName);

            htmlContent += '<div class="item">' + obj.ActionTypeName + '</div>';
        });
        $('#MaterialContent').append(htmlContent);
    }
</script>
